package graph.drawingshapes.shapes
{
	import graph.drawingshapes.RedrawEvent;
	import graph.geometricshapes.GeometricRectangle;
	import graph.geometricshapes.GeometricShapeFactory;
	
	public class RectangleShape extends FilledDrawingShape
	{
		public static const NAME:String = "RectangleShape";
		public override function get getName():String
		{
			return NAME;
		}
		
		public function RectangleShape(x:Number=DefaultX, y:Number=DefaultY, width:Number=DefaultWidth, height:Number=DefaultHeight)
		{
			super(x,y);
			this.geometricShape = GeometricShapeFactory.createShape(GeometricRectangle.NAME, width, height);
			dispatchEvent(new RedrawEvent());
		}		
		
		protected override function draw():void
		{
			super.draw();
			this.graphics.drawRect(0, 0, width, height);
		}
	}
}